package com.zlc.platform.controller;

import com.zlc.common.annotation.LogSaveAnnotation;
import com.zlc.common.common.constant.PlatConstant;
import com.zlc.common.core.sys.model.vo.MayanPlatParameterVo;
import com.zlc.platform.model.SysParameterEntity;
import com.zlc.platform.service.SysParameterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Api(tags = "系统参数相关")
@RestController
@RequestMapping("/api/parameter")
public class SysParameterController {

    @Autowired
    private SysParameterService sysParameterService;

    @ApiOperation(value = "查询系统参数")
    @PostMapping(value = "/queryParameterList")
    public List<SysParameterEntity> queryParameterList() {
        return sysParameterService.queryParameterList();
    }

    @ApiOperation(value = "修改系统参数")
    @PostMapping(value = "/changeParameters")
    @LogSaveAnnotation(module = PlatConstant.UC_APP_MODULE, recordRequestParam = true,title = "修改系统参数",catalog = "基础配置/系统参数")
    public void changeParameters(@RequestBody List<MayanPlatParameterVo> parameterVos) {
        sysParameterService.changeParameters(parameterVos);
    }
}
